{
Antonov_Kirill
19.09.2012.
this program is to find the common factor of 3 numbers
}
program Firstnumber;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  a,c, b, i, min: integer;

begin
  readln(a);
  readln(b);
  readln(c);
  writeln;
  if (a>b) and (b>c) then
    min:=c;
  if (a>b) and (c>b) then
    min:=b;
  if (a<b) and (a<c) then
    min:=a;
  for i:=1 to min do
  begin
    if ((min mod i)=0) then
    begin
      if((a mod i)=0) then
      begin
        if((b mod i)=0) then
        begin
          if((c mod i)=0) then
            write(i, ' ');
        end;
      end;
    end;
  end;
  readln;

end.
